#封装日志和邮件
import logging
from logging import DEBUG

import yagmail


#封装日志
def log_set():
    logging.basicConfig(level=DEBUG,format='%(filename)s-%(asctime)s-%(message)s',filename='log.txt')

#封装邮件
def mail_send(filename):
    mail=yagmail.SMTP(user='2609277512@qq.com',password='mfwqcodyhqaeebed',host='smtp.qq.com')
    mail.send(to='2609277512@qq.com',subject='html_report',contents='这是一个测试报告',attachments=filename)


